
<%@ page import="com.ContaContabil"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'contaContabil.label', default: 'ContaContabil')}" />
<title><g:message code="default.list.label" args="[entityName]" />
</title>
</head>
<body>
	<div class="nav"></div>
	<h1 id="pageName">DRE</h1>
	<table class="IadTableList">

		<tbody>
		<tr>
		<td class="value" style="font-size: 18px;color:#025647;font-weight: bold;">
				1-ATIVO
			</td>
			<td class="value" style="font-size:15px; text-align:right;color: #025647;font-weight: bold;" >
				${saldoContas.ativo}
			</td>
		</tr>
		
			<g:each in="${dreContas}" status="i" var="dreContas">
				<g:if
					test="${dreContas.contaContabel.pai.codigo == ContaContabil.ATIVO}">
					<tr>
						<td class="value" style="font-size: 15px; text-indent: 4em;color: #13601F;">
							${dreContas.contaContabel}
						</td>
						<td class="value" style="font-size:15px;text-align:center;color: #13601F;" >
							${dreContas.saldoConta}
						</td>
					</tr>
				</g:if>
			</g:each>
		<tr></tr>
		<tr></tr>	
		<tr></tr>
		<tr></tr>
		
		<tr>
			<td class="value" style="font-size: 18px;color:#025647;font-weight: bold;">
				2-PASSIVO
			</td>
			<td class="value" style="font-size:15px; text-align:right;color: #025647;font-weight: bold;" >
				${saldoContas.passivo}
			</td>
		</tr>
			<g:each in="${dreContas}" status="i" var="dreContas">
				<g:if
					test="${dreContas.contaContabel.pai.codigo == ContaContabil.PASSIVO}">
					<tr>
						<td class="value" style="font-size: 15px; text-indent: 4em;color: #13601F;">
							${dreContas.contaContabel}
						</td>
						<td class="value" style="font-size:15px;text-align:center;color: #13601F;" >
							${dreContas.saldoConta}
						</td>
					</tr>
				</g:if>
			</g:each>
		<tr></tr>
		<tr></tr>	
		<tr></tr>
		<tr></tr>
		
		<tr>
			<td class="value" style="font-size: 18px;color:#025647;font-weight: bold;">
				3-RECEITAS
			</td>
			<td class="value" style="font-size:15px; text-align:right;color: #025647;font-weight: bold;" >
				${saldoContas.receita}
			</td>
		</tr>
			<g:each in="${dreContas}" status="i" var="dreContas">
				<g:if
					test="${dreContas.contaContabel.pai.codigo == ContaContabil.RECEITA}">
					<tr>
						<td class="value" style="font-size: 15px; text-indent: 4em;color: #13601F;">
							${dreContas.contaContabel}
						</td>
						<td class="value" style="font-size:15px;text-align:center;color: #13601F;" >
							${dreContas.saldoConta}
						</td>
					</tr>
				</g:if>
			</g:each>
		<tr></tr>
		<tr></tr>
		<tr></tr>
		<tr></tr>
		
		<tr>
			<td class="value" style="font-size: 18px;color:#025647;font-weight: bold;">
				4-CUSTOS E DESPESAS
			</td>
			<td class="value" style="font-size:15px; text-align:right;color: #025647;font-weight: bold;" >
				${saldoContas.custoDespesa}
			</td>
		</tr>
			<g:each in="${dreContas}" status="i" var="dreContas">
				<g:if
					test="${dreContas.contaContabel.pai.codigo == ContaContabil.CUSTOS_DESPESAS}">
					<tr>
						<td class="value" style="font-size: 15px; text-indent: 4em;color: #13601F;">
							${dreContas.contaContabel}
						</td>
						<td class="value" style="font-size:15px;text-align:center;color: #13601F;" >
							${dreContas.saldoConta}
						</td>
					</tr>
				</g:if>
			</g:each>
		<tr></tr>
		<tr></tr>
		<tr></tr>
		<tr></tr>
		<tr>
		<td class="value" style="font-size: 18px;color:#025647;font-weight: bold;">
				RESULTADO
			</td>
		<td class="value" style="font-size:15px; text-align:right;color: #025647;font-weight: bold;" >
				${- saldoContas.receita - saldoContas.custoDespesa}
			</td>
		</tr>
		</tbody>
	</table>
</body>
</html>
